package com.liujun.spring4.demo.aop.iocset.annotation.autowired.lazy;

import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * 对于lazy的标签，是在进行方法或者属性的调用时，才调用方法进行创建
 *
 * @author liujun
 * @version 1.0
 * @date 2018-08-19 16:42:00
 */
@Lazy
@Component
public class LazyServiceImpl implements LazyService {

  public LazyServiceImpl() {
    System.out.println("延迟加载，构造方法调用");
  }

  @Override
  public void lazyMethod(String method) {
    System.out.println("LazyServiceImpl run param:" + method);
  }
}
